﻿<Window x:Class="ContentFactory.ProjectSettingsDialog"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="{DynamicResource ProjectSettingsDialog_Title}" SizeToContent="WidthAndHeight" WindowStartupLocation="CenterOwner" ShowInTaskbar="False" ResizeMode="NoResize"
        Closing="Window_Closing">
    <Window.Resources>
        <Style TargetType="{x:Type ListViewItem}">
            <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        </Style>
        <Style TargetType="{x:Type TextBox}">
            <Setter Property="IsReadOnly" Value="True"/>
            <Setter Property="VerticalAlignment" Value="Center"/>
        </Style>
        <Style x:Key="BrowserDirectoryButtonStyle" TargetType="{x:Type Button}">
            <Setter Property="Content" Value="{DynamicResource ProjectSettingsDialog_Button_Browser}"/>
            <Setter Property="Padding" Value="6,2"/>
            <Setter Property="Margin" Value="6,0"/>
            <Setter Property="VerticalAlignment" Value="Center"/>
            <EventSetter Event="Click" Handler="Button_BrowserDirectory_Click"/>
        </Style>
        <Style x:Key="BrowserFileButtonStyle" TargetType="{x:Type Button}">
            <Setter Property="Content" Value="{DynamicResource ProjectSettingsDialog_Button_Browser}"/>
            <Setter Property="Padding" Value="6,2"/>
            <Setter Property="Margin" Value="6,0"/>
            <Setter Property="VerticalAlignment" Value="Center"/>
            <EventSetter Event="Click" Handler="Button_BrowserFile_Click"/>
        </Style>
        <Style x:Key="ClearButtonStyle" TargetType="{x:Type Button}">
            <Setter Property="Content" Value="{DynamicResource ProjectSettingsDialog_Button_Clear}"/>
            <Setter Property="Padding" Value="6,2"/>
            <!--<Setter Property="Margin" Value="6,0"/>-->
            <Setter Property="VerticalAlignment" Value="Center"/>
            <EventSetter Event="Click" Handler="Button_Clear_Click"/>
        </Style>
    </Window.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="320"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <ListView ItemsSource="{Binding Configurations}" Margin="6,6,6,0">
            <ListView.View>
                <GridView>
                    <GridViewColumn Header="{DynamicResource ProjectSettingsDialog_ListView_Column_Build}" Width="48">
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <CheckBox IsChecked="{Binding Build}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                    <GridViewColumn Header="{DynamicResource ProjectSettingsDialog_ListView_Column_Platform}" Width="120">
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding GamePlatform}" HorizontalAlignment="Center"/>
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                    <GridViewColumn Header="{DynamicResource ProjectSettingsDialog_ListView_Column_Directory}" Width="280">
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <DockPanel>
                                    <Button Style="{StaticResource BrowserDirectoryButtonStyle}" DockPanel.Dock="Right"/>
                                    <TextBox Text="{Binding ProjectDirectory}"/>
                                </DockPanel>
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                    <GridViewColumn Header="{DynamicResource ProjectSettingsDialog_ListView_Column_Project}" Width="280">
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <DockPanel>
                                    <Button Style="{StaticResource ClearButtonStyle}" DockPanel.Dock="Right"/>
                                    <Button Style="{StaticResource BrowserFileButtonStyle}" DockPanel.Dock="Right"/>
                                    <TextBox Text="{Binding ProjectFile}"/>
                                </DockPanel>
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                </GridView>
            </ListView.View>
        </ListView>
        <CheckBox Content="{DynamicResource ProjectSettingsDialog_CheckBox_Compress}" IsChecked="{Binding DefaultCompressContent}" Margin="6" Grid.Row="1"/>
    </Grid>
</Window>
